<?php
/*
	获取活动详情
	电商客商品列表页和商品详情页会调用本方法以获得商品详情
*/
defined('BY_JYA') or exit('error');
list($goods_id,$active_id)=$arguments;
$prams=array('gid'=>$goods_id,'uniacid'=>$_SESSION['uniacid']);
$basic=$this->plugin_setting('basic');
//$prams['mid']=$_SESSION['uid'];
$plugininfo=pdo_get('jy_taobaoke_url',$prams,array('id','url','code'));
if(!$plugininfo['url']){
	//获取口令链接/推广链接：
	$item_url=pdo_getcolumn('jy_taobaoke_goods',array('goodsid'=>$goods_id,'uniacid'=>$_SESSION['uniacid']),'item_url');
	$goods['active']['url']=$item_url;
	//$this->model('model')->getcode($item_url,$_SESSION['uid']);
}else{
	$goods['active']['url']=$plugininfo['url'];
	$goods['active']['code']=$plugininfo['code'];
}
$tk_rate=pdo_getcolumn('jy_taobaoke_goods',array('goodsid'=>$goods_id,'uniacid'=>$_SESSION['uniacid']),'tk_rate');
$price=pdo_getcolumn('jy_weishop_goods',array('id'=>$goods_id,'uniacid'=>$_SESSION['uniacid']),'price');
if($this->plugin_exists('jy_weishopke')){
	$set=plugin('jy_weishopke')->plugin_setting('basic');
}
$set['ratio']=$set['ratio']?:'50';
$set['vipratio']=$set['vipratio']?:'90';
$tk_rate=intval($tk_rate)?:5;
$getfee=$tk_rate*$price/100;
$goods['active']['ke_money']=price($getfee*$set['ratio']/100,true);
$goods['active']['keup_money']=price($getfee*$set['vipratio']/100,true);
$goods['active']['ke_title']=$set['ke_title']?:'预估赚';
$goods['active']['typeke']='taobao';
return $goods['active'];